<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../../base.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
</head>
<body>
<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            基本信息
            <small>产品信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="all-order-manage-list.html">基本信息</a></li>
            <li class="active">产品信息</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
    <section class="content">

        <!--订单信息-->
        <div class="panel panel-default">
            <div class="panel-heading">新增产品</div>
            <form id="editForm" action="${ctx}/baseinfo/product/edit.do" method="post">
                <input type="hidden" name="id" value="${factoryProduct.id}">
                <input type="hidden" name="factoryId" id="factoryId" value="${factoryProduct.factoryId}">

                <div class="row data-type" style="margin: 0px">

                    <div class="col-md-2 title">生产厂家</div>
                    <div class="col-md-4 data">
                        <select class="form-control"  name="describeFactory" id="factoryName" onchange="document.getElementById('factoryName').value=this.options[this.selectedIndex].text">
                            <option value="factoryName">请选择</option>
                            <c:forEach items="${factoryList}" var="factory">
                                <option value="${factory.factoryName}">${factory.factoryName}</option>
                            </c:forEach>
                        </select>
                    </div>


                    <div class="col-md-2 title">产品类别</div>
                    <div class="col-md-4 data">
                        <select class="form-control"  name="ctype" id="ctype" onchange="document.getElementById('ctype').value=this.options[this.selectedIndex].text">
                            <option value="">请选择</option>
                            <c:forEach items="${ctypeList}" var="ctype">
                                <option value="${ctype}">${ctype}</option>
                            </c:forEach>
                        </select>
                    </div>

                    <div class="col-md-2 title">产品名称</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="产品名称" name="synopsis" value="${factoryProduct.synopsis}">
                    </div>


                <%--<div class="col-md-2 title">产品照片</div>--%>
                    <%--<div class="col-md-4 data">--%>
                        <%--<input type="file" class="form-control" placeholder="产品照片" name="pImg" value="${factoryProduct.pImg}">--%>
                    <%--</div>--%>

                    <div class="col-md-2 title">尺寸长</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸长" name="sizeLength" value="${factoryProduct.sizeLength}">
                    </div>

                    <div class="col-md-2 title">尺寸宽</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸宽" name="sizeWidth" value="${factoryProduct.sizeWidth}">
                    </div>

                    <div class="col-md-2 title">尺寸高</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸高" name="sizeHeigth" value="${factoryProduct.sizeHeigth}">
                    </div>


                    <div class="col-md-2 title">包装单位</div>
                    <div class="col-md-4 data">
                        <div class="form-group form-inline">
                            <div class="radio"><label><input type="radio" ${factoryProduct.packing=="PCS"?'checked':''} name="packing" value="PCS">PCS</label></div>
                            <div class="radio"><label><input type="radio" ${factoryProduct.packing=="SETS"?'checked':''} name="packing" value="SETS">SETS</label></div>
                        </div>
                    </div>


                    <div class="col-md-2 title">数量</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="数量" name="pNumber" value="${factoryProduct.pNumber}">
                    </div>


                    <div class="col-md-2 title">市场价</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="市场价" name="price" value="${factoryProduct.price}">
                    </div>

                </div>
            </form>
        </div>
        <!--订单信息/-->

        <!--工具栏-->
        <div class="box-tools text-center">
            <button type="button" onclick='document.getElementById("editForm").submit()' class="btn bg-maroon">保存</button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>
        <!--工具栏/-->

    </section>
    <!-- 正文区域 /-->

    <section class="content">

        <!-- .box-body -->
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">产品列表</h3>
            </div>

            <div class="box-body">

                <!-- 数据表格 -->
                <div class="table-box">
                    <!--数据列表-->
                    <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                        <thead>
                        <tr>
                            <td class="tableHeader"><input type="checkbox" name="selid" onclick="checkAll('id',this)"></td>
                            <td class="tableHeader">序号</td>
                            <td class="tableHeader">产品名称</td>
                            <td class="tableHeader">产品类型</td>
                            <td class="tableHeader">生产厂家</td>

                            <td class="tableHeader">数量</td>
                            <td class="tableHeader">市场价</td>
                            <td class="tableHeader">体积</td>
                            <td class="tableHeader">操作</td>
                        </tr>
                        </thead>
                        <tbody class="tableBody" >
                        ${links }

                            <c:forEach items="${page.list}" var="pb" varStatus="status" >
                              <tr class="odd" onmouseover="this.className='highlight'" onmouseout="this.className='odd'">

                                 <td><input type="checkbox" name="id" value="${pb.id}"/></td>
                                 <td>${status.index+1}</td>
                                 <td>${pb.synopsis}</td>
                                 <td>${pb.ctype}</td>
                                 <td>${pb.describeFactory}</td>
                                 <td>${pb.pNumber}</td>
                                 <td>${pb.price}</td>
                                 <td>${pb.bulk}</td>

                                <td>
                                    <a href="${ctx}/baseinfo/product/toUpdate.do?id=${pb.id}">[编辑]</a>
                                    <a href="${ctx}/baseinfo/product/delete.do?id=${pb.id}">[删除]</a>
                                </td>
                            </tr>
                        </c:forEach>


                        </tbody>
                    </table>
                    <!--数据列表/-->
                    <!--工具栏/-->
                </div>
                <!-- 数据表格 /-->
            </div>
            <!-- /.box-body -->

            <!-- .box-footer-->
            <div class="box-footer">
                <jsp:include page="../../common/page.jsp">
                    <jsp:param value="/baseinfo/product/list.do" name="pageUrl"/>
                </jsp:include>
            </div>
            <!-- /.box-footer-->
        </div>

    </section>

</div>
<!-- 内容区域 /-->
</body>

</html>
